package com.junzhiit.nengji.cms.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.bainaeco.framework.util.AssertUtil;
import com.junzhiit.nengji.cms.service.WaterMarkService;
import com.junzhiit.nengji.cms.web.vo.ResultVO;
import com.junzhiit.nengji.cms.web.vo.WaterMarkVO;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/water/mark")
public class WaterMarkController extends BaseController {

	@Autowired
	WaterMarkService waterMarkService;
	
	@ApiOperation(value="给图片添加水印")
	@RequestMapping(value="/add",method=RequestMethod.POST)
	public ResultVO addWaterMark(HttpServletResponse response, HttpServletRequest request,WaterMarkVO wmv){
		AssertUtil.notBlank(wmv.getSrcImg(), "srcImg is required");
		AssertUtil.notBlank(wmv.getIcon(),"icon is required");
		return waterMarkService.addWaterMark(response,request,wmv);
	}
}
